import Vue from 'vue'
import App from './App'
// 整合vuex
import store from './store/index.js'
Vue.config.productionTip = false
//格式化时间组件moment,npm i一下.
import moment from 'moment'
moment.locale('zh-cn');
Vue.prototype.$moment = moment;//赋值使用

import requestConfig from './js_sdk/zhouWei-request/requestConfig';
Vue.prototype.$httpWay = requestConfig;

import requestConfigApiJson from './js_sdk/zhouWei-request/requestConfigApiJson';
Vue.prototype.$httpApi = requestConfigApiJson;

import requestConfigFuck from './js_sdk/zhouWei-request/requestConfigFuck';
Vue.prototype.$httpFuck = requestConfigFuck;

import requestConfigTxn from './js_sdk/zhouWei-request/requestConfigTxn';
Vue.prototype.$httpTxn = requestConfigTxn;

import uniApp from '@/components/js/uniApp.js';
Vue.prototype.$uniApp = uniApp;



App.mpType = 'app'

const app = new Vue({
    ...App,
	store
})

app.$mount()

Vue.prototype.showToast = (data) => {
	uni.showToast({
	    title: data,
	    duration: 2000
	});
}

Vue.prototype.suspend = () => {
	uni.showToast({
	    title: '暂未开发，敬请期待',
	    duration: 2000
	});
}

Vue.prototype.navigateTo = (page,title) => {
	Vue.prototype.$uniApp.invokeSetTimeout('navigateTo',{url: page},title);
}

Vue.prototype.switchTab = (page,title) => {
	Vue.prototype.$uniApp.invokeSetTimeout('switchTab',{url: page},title);
}

Vue.prototype.downloadFile = (url,title, success = res => {}) => {
	Vue.prototype.$uniApp.invokeSetTimeout('downloadFile',{url: url ,success : success },title);
}